﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<List<VCC.Model.Ad>>"%>
<%@ Import Namespace="VCC.Model"%>
<%@ Import Namespace="VCC.Lib.Helpers" %>
<%@ Import Namespace="VCC.Lib.Common"%>
<%if (Model != null && Model.Count() > 0)
  {%>
    <% foreach (var item in Model)
       {
         if (item.VIPTypeID == 1)
                               {%>
                                <div class="vip0">
                                    <div class="p-title">
                                        <h3>
                                            <a style="text-rendering: optimizeLegibility;" title="<%=item.Title %>" href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>"><%= Html.Encode(item.Title.Length > 110 ? TextHelper.CutString(item.Title, 110) + ".." : item.Title)%></a><%=Utils.CheckNewAdToDay(item.StartDate.Value)%>
                                        </h3>
                                    </div>
                                    <div class="p-main">
                                        <div class="p-main-image-crop">
                                            <a href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>" class="product-avatar">
                                                <img title="<%=item.Title %>" alt="<%=item.Title %>" src="<%=LinkUtils.UrlImageOrDefault(item.AvataImage)%>" class="product-avatar-img"> 
                                            </a>
                                        </div>
                                        <div class="p-content">
                                            <div style="text-rendering: optimizeLegibility;" class="p-main-text">
                                                <%=item.Content != null && item.Content.Length > 200 ? TextHelper.CutAndRemoveHtml(item.Content, 250) + ".." : TextHelper.RemoveHTML(item.Content)%>
                                            </div>
                                        </div>
                                        <div class="p-bottom-crop">
                                            <div class="floatleft">
                                                Giá: <span class="product-price"><%=string.Format("{0:#,#}",item.Cost)%> <%=item.CostType!= null ? item.CostType.Name : "$"%></span>&nbsp; Khu vực: <span class="product-city-dist"><%=item.Suburb.FullName %></span>
                                            </div>
                                            <div style="padding-right: 10px;" class="floatright"><%= VCC.Lib.Common.Utils.DateTimeToStringFormat(item.StartDate.Value)%></div>
                                                
                                            <div class="clear"></div>
                                        </div>
                                    </div>
                                    <div class="clear10"></div>
                                </div>
                                <%}
                               else if (item.VIPTypeID == 2)
                               {%>
                               <div class="vip1">
                                    <div class="p-title">
                                        <h3>
                                            <a style="text-rendering: optimizeLegibility;" title="<%=item.Title %>" href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>"><%= Html.Encode(item.Title.Length > 110 ? TextHelper.CutString(item.Title, 110) + ".." : item.Title)%></a><%=Utils.CheckNewAdToDay(item.StartDate.Value)%>
                                        </h3>
                                    </div>
                                    <div class="p-main">
                                        <div class="p-main-image-crop">
                                            <a href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>" class="product-avatar">
                                                <img title="<%=item.Title %>" alt="<%=item.Title %>" src="<%=LinkUtils.UrlImageOrDefault(item.AvataImage)%>" class="product-avatar-img"> 
                                            </a>
                                        </div>
                                        <div class="p-content">
                                            <div style="text-rendering: optimizeLegibility;" class="p-main-text">
                                                <%=item.Content != null && item.Content.Length > 200 ? TextHelper.CutAndRemoveHtml(item.Content, 250) + ".." : TextHelper.RemoveHTML(item.Content)%>
                                            </div>
                                        </div>
                                        <%--<div class="clear"></div>--%>
                                        <div class="p-bottom-crop">
                                            <div class="floatleft">
                                                Giá: <span class="product-price"><%=string.Format("{0:#,#}",item.Cost)%> <%=item.CostType!= null ? item.CostType.Name : "$"%></span>&nbsp; Khu vực: <span class="product-city-dist"><%=item.Suburb.FullName %></span>
                                            </div>
                                            <div style="padding-right: 10px;" class="floatright"><%= VCC.Lib.Common.Utils.DateTimeToStringFormat(item.StartDate.Value)%></div>
                                            <div class="clear"></div>
                                        </div>
                                    </div>
                                    <div class="clear10"></div>
                                </div>
                                <%}
                               else if (item.VIPTypeID == 3)
                               {%>
                               <div class="vip2">
                                    <div class="p-title">
                                        <h3>
                                            <a style="text-rendering: optimizeLegibility;" title="<%=item.Title %>" href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>"><%= Html.Encode(item.Title.Length > 110 ? TextHelper.CutString(item.Title, 110) + ".." : item.Title)%></a><%=Utils.CheckNewAdToDay(item.StartDate.Value)%>
                                        </h3>
                                    </div>
                                    <div class="p-main">
                                        <div class="p-main-image-crop">
                                            <a href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>" class="product-avatar">
                                                <img title="<%=item.Title %>" alt="<%=item.Title %>" src="<%=LinkUtils.UrlImageOrDefault(item.AvataImage)%>" class="product-avatar-img"> 
                                            </a>
                                        </div>
                                        <div class="p-content">
                                            <div style="text-rendering: optimizeLegibility;" class="p-main-text">
                                                <%=item.Content != null && item.Content.Length > 200 ? TextHelper.CutAndRemoveHtml(item.Content, 250) + ".." : TextHelper.RemoveHTML(item.Content)%>
                                            </div>
                                        </div>
                                        <div class="p-bottom-crop">
                                            <div class="floatleft">
                                                Giá: <span class="product-price"><%=string.Format("{0:#,#}",item.Cost)%> <%=item.CostType!= null ? item.CostType.Name : "$"%></span>&nbsp; Khu vực: <span class="product-city-dist"><%=item.Suburb.FullName %></span>
                                            </div>
                                            <div style="padding-right: 10px;" class="floatright"><%= VCC.Lib.Common.Utils.DateTimeToStringFormat(item.StartDate.Value)%></div>
                                            <div class="clear"></div>
                                        </div>
                                    </div>
                                    <div class="clear10"></div>
                                </div>
                                <%}
                               else if (item.VIPTypeID == 4)
                               {%>
                               <div class="vip3">
                                    <div class="p-title">
                                        <h3>
                                            <a style="text-rendering: optimizeLegibility;" title="<%=item.Title %>" href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>"><%= Html.Encode(item.Title.Length > 110 ? TextHelper.CutString(item.Title, 110) + ".." : item.Title)%></a><%=Utils.CheckNewAdToDay(item.StartDate.Value)%>
                                        </h3>
                                    </div>
                                    <div class="p-main">
                                        <div class="p-main-image-crop">
                                            <a href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>" class="product-avatar">
                                                <img title="<%=item.Title %>" alt="<%=item.Title %>" src="<%=LinkUtils.UrlImageOrDefault(item.AvataImage)%>" class="product-avatar-img"> 
                                            </a>
                                        </div>
                                        <div class="p-content">
                                            <div style="text-rendering: optimizeLegibility;" class="p-main-text">
                                                <%=item.Content!= null && item.Content.Length > 200 ? TextHelper.CutAndRemoveHtml(item.Content,250) + ".." : TextHelper.RemoveHTML(item.Content)%>
                                            </div>
                                        </div>
                                        <div class="p-bottom-crop">
                                            <div class="floatleft">
                                                Giá: <span class="product-price"><%=string.Format("{0:#,#}",item.Cost)%> <%=item.CostType!= null ? item.CostType.Name : "$"%></span>&nbsp; Khu vực: <span class="product-city-dist"><%=item.Suburb.FullName %></span>
                                            </div>
                                            <div style="padding-right: 10px;" class="floatright"><%= VCC.Lib.Common.Utils.DateTimeToStringFormat(item.StartDate.Value)%></div>
                                            <div class="clear"></div>
                                        </div>
                                    </div>
                                    <div class="clear10"></div>
                                </div>
                                <%}
                               else if (item.VIPTypeID == 5)
                               {%>
                                <div class="vip5">
                                    
                                    <div class="p-main">
                                        <div class="p-main-image-crop">
                                            <a href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>" class="product-avatar">
                                                <img title="<%=item.Title %>" alt="<%=item.Title %>" src="<%=LinkUtils.UrlImageOrDefault(item.AvataImage)%>" class="product-avatar-img"> 
                                            </a>
                                        </div>
                                        <div class="p-title">
                                            <h3>
                                                <a style="text-rendering: optimizeLegibility;" title="<%=item.Title %>" href="<%= LinkUtils.UrlAdDetails(item.Title,item.ID)%>"><%= Html.Encode(item.Title.Length > 110 ? TextHelper.CutString(item.Title, 110) + ".." : item.Title)%></a><%=Utils.CheckNewAdToDay(item.StartDate.Value)%>
                                            </h3>
                                        </div>
                                        <div class="p-content">
                                            <div style="text-rendering: optimizeLegibility;" class="p-main-text">
                                                <%=item.Content != null && item.Content.Length > 200 ? TextHelper.CutAndRemoveHtml(item.Content, 200) + ".." : TextHelper.RemoveHTML(item.Content)%>
                                            </div>
                                        </div>
                                        <div class="p-bottom-crop">
                                            <div class="floatleft">
                                                Giá: <span class="product-price"><%=string.Format("{0:#,#}",item.Cost)%> <%=item.CostType!= null ? item.CostType.Name : "$"%></span>&nbsp; Khu vực: <span class="product-city-dist"><%=item.Suburb.FullName %></span>
                                            </div>
                                            <div style="padding-right: 10px;" class="floatright"><%= VCC.Lib.Common.Utils.DateTimeToStringFormat(item.StartDate.Value)%></div>
                                            <div class="clear"></div>
                                        </div>
                                    </div>
                                    <div class="clear10"></div>
                                </div>
                            <%}                       
       }
  }
  else
  {%>
    <div style="text-align:center; padding:20px 0px 20px 0px;">
        Tin rao đang được cập nhật!
    </div>
  <%} %>
  <div class="clear10"></div>
